cmake_minimum_required(VERSION 2.6)
project(daqAdapter)

#find NIDAQmx

if (WIN32)
set(NIDAQ_DIR  C:\\Program\ Files\\National\ Instruments\\NI-DAQ\\DAQmx\ ANSI\ C\ Dev)
find_library(NIDAQmxLib nidaqmx.lib HINTS ${NIDAQ_DIR}\\lib\\msvc)
include_directories(${NIDAQ_DIR}\\include)
message(${NIDAQmxLib})
else (WIN32)
	message("Please setup unix nidaq stuff here")
endif(WIN32)


#############################################################################
#daqAdapter lib+test 
#############################################################################
add_library(daqAdapter daqAdapter.cpp daqAdapter.h)
add_executable(daqAdapterTest daqAdapterTest.cpp)
target_link_libraries(daqAdapterTest daqAdapter ${NIDAQmxLib})
install(TARGETS daqAdapter daqAdapterTest DESTINATION bin)


#Build Mex Function
#set(MATLAB_DIR C:\\Program\ Files\\MATLAB\\R2010b)
#include_directories(${MATLAB_DIR}\\extern\\include)
#add_library(daqAdapterMex STATIC daqAdapterMex.cpp)
#set(bindir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
#add_custom_command(
#	TARGET daqAdapterMex POST_BUILD 
#	COMMAND "${MATLAB_DIR}\\bin\\mex.bat" ${bindir}/daqAdapterMex.lib ${bindir}/daqAdapter.lib ${NIDAQmxLib} -output ${CMAKE_INSTALL_PREFIX}/bin/daqAdapterMex
#)
